<?php if (!defined('THINK_PATH')) exit(); /*a:3:{s:52:"D:\WWW\epes/application/admin\view\index\login1.html";i:1516604069;s:53:"D:\WWW\epes/application/admin\view\public\header.html";i:1515988606;s:53:"D:\WWW\epes/application/admin\view\public\footer.html";i:1515988606;}*/ ?>
<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="renderer" content="webkit">
    <title><?php echo cache('site_name'); ?>后台管理系统</title>
    <!--[if lt IE 9]>
    <meta http-equiv="refresh" content="0;ie.html" />
    <![endif]-->
    <link rel="shortcut icon" href="/public/static/admin/favicon.ico">
    <link href="/public/static/admin/assets/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="/public/static/admin/assets/css/font-awesome.min.css?v=4.4.0" rel="stylesheet">
    <link href="/public/static/admin/assets/css/animate.css" rel="stylesheet">
    <link href="/public/static/admin/assets/css/style.css?v=4.1.0" rel="stylesheet">
    <link href="/public/static/admin/assets/js/plugins/ztree/css/metroStyle/metroStyle.css" rel="stylesheet">
    <link href="/public/static/admin/assets/css/plugins/iCheck/custom.css" rel="stylesheet">
    <link href="/public/static/admin/assets/js/plugins/bootstrap-fileinput/css/fileinput.min.css" rel="stylesheet">
    <link href="/public/static/admin/assets/css/plugins/codemirror/codemirror.css" rel="stylesheet">
    <link href="/public/static/admin/assets/css/plugins/codemirror/ambiance.css" rel="stylesheet">
    <link href="/public/static/admin/assets/js/plugins/bootstrap-table/src/bootstrap-table.css" rel="stylesheet">
    <link href="/public/static/admin/assets/css/plugins/toastr/toastr.min.css" rel="stylesheet">
    <link href="/public/static/admin/assets/css/plugins/datapicker/datepicker3.css" rel="stylesheet">
</head>


<link href="/public/static/admin/assets/css/login.css" rel="stylesheet">
<!--[if lt IE 9]>
<meta http-equiv="refresh" content="0;ie.html" />
<![endif]-->
<script>
    if (window.top !== window.self) {
        window.top.location = window.location;
    }
</script>
</head>
<body class="signin">
<div class="signinpanel">
    <div class="row">
        <div class="col-sm-7">
            <div class="signin-info">
                <div class="logopanel m-b">
                    <h1>[ <?php echo cache('site_name'); ?> ]</h1>
                </div>
                <div class="m-b"></div>
                <h4>欢迎使用 <strong><?php echo cache('site_name'); ?></strong></h4>
                <ul class="m-b">
                    <li><i class="fa fa-arrow-circle-o-right m-r-xs"></i> 优势一</li>
                    <li><i class="fa fa-arrow-circle-o-right m-r-xs"></i> 优势二</li>
                    <li><i class="fa fa-arrow-circle-o-right m-r-xs"></i> 优势三</li>
                    <li><i class="fa fa-arrow-circle-o-right m-r-xs"></i> 优势四</li>
                    <li><i class="fa fa-arrow-circle-o-right m-r-xs"></i> 优势五</li>
                </ul>
                <strong>还没有账号？ <a href="#">立即注册&raquo;</a></strong>
            </div>
        </div>
        <div class="col-sm-5">
            <form method="post"  id="login-form">
                <h4 class="no-margins">登录：</h4>
                <p class="m-t-md">登录到后台管理系统</p>
                <input type="text" class="form-control uname" name="login_name" placeholder="用户名"  id="name"/>
                <input type="password" class="form-control pword m-b" name="pwd" placeholder="密码"  id="pwd"/>
                <!--验证码-->
                <?php if(cache('captcha_flag')==1): ?>
                <input type="text" class="form-control pword m-b" name="captcha" placeholder="验证码"  id="captcha"/>
                <div><img id="verify_img" src="<?php echo captcha_src(); ?>" alt="验证码" onclick="refreshVerify()">
                    <a href="javascript:refreshVerify()">点击刷新</a></div>
                <br/>
                <?php endif; ?>
                <!--/验证码-->
                <div style="color:red;margin-bottom: 10px;" id="errMsg"><?php echo cache('water_flag'); ?></div>
                <a href="">忘记密码了？</a>
                <button class="btn btn-success btn-block" onclick="login()" type="button">登录</button>
            </form>
        </div>
    </div>
    <div class="signup-footer">
        <div class="pull-left">
            &copy; 2018 All Rights Reserved. H+
        </div>
    </div>
</div>
<!-- 全局js -->
<script src="/public/static/admin/assets/js/jquery.min.js?v=2.1.4"></script>
<script src="/public/static/admin/assets/js/bootstrap.min.js?v=3.3.6"></script>
<script src="/public/static/admin/assets/js/plugins/metisMenu/jquery.metisMenu.js"></script>
<script src="/public/static/admin/assets/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>

<!-- 自定义js -->
<script src="/public/static/admin/assets/js/hplus.js?v=4.1.0"></script>
<script src="/public/static/admin/assets/js/contabs.js"></script>
<script src="/public/static/admin/loa/js/table.js"></script>

<!-- 第三方插件 -->
<script src="/public/static/admin/assets/js/plugins/pace/pace.min.js"></script>
<script src="/public/static/admin/assets/js/plugins/iCheck/icheck.min.js"></script>
<script src="/public/static/admin/assets/js/plugins/bootstrap-fileinput/js/fileinput.js"></script>
<script src="/public/static/admin/assets/js/plugins/bootstrap-fileinput/js/fileinput_locale_zh.js"></script>
<script src="/public/static/admin/assets/js/plugins/treeview/bootstrap-treeview.js"></script>
<script src="/public/static/admin/assets/js/plugins/ueditor/ueditor.config.js"></script>
<script src="/public/static/admin/assets/js/plugins/ueditor/ueditor.all.min.js"></script>
<script src="/public/static/admin/assets/js/plugins/ueditor/lang/zh-cn/zh-cn.js"></script>
<script src="/public/static/admin/assets/js/plugins/ztree/js/jquery.ztree.core.min.js"></script>
<script src="/public/static/admin/assets/js/plugins/ztree/js/jquery.ztree.excheck.min.js"></script>
<script src="/public/static/admin/assets/js/plugins/codemirror/codemirror.js"></script>
<script src="/public/static/admin/assets/js/plugins/codemirror/mode/javascript/javascript.js"></script>
<script src="/public/static/admin/assets/js/plugins/bootstrap-table/src/bootstrap-table.min.js"></script>
<script src="/public/static/admin/assets/js/plugins/bootstrap-table/bootstrap-table-mobile.min.js"></script>
<script src="/public/static/admin/assets/js/plugins/bootstrap-table/src/locale/bootstrap-table-zh-CN.min.js"></script></html>
<script src="/public/static/admin/assets/js/plugins/bootstrap-table/src/extensions/export/bootstrap-table-export.js"></script></html>
<script src="/public/static/admin/assets/js/plugins/tableExport.jquery.plugin/tableExport.min.js"></script></html>
<script src="/public/static/admin/assets/js/jquery.serializejson.min.js"></script>
<script src="/public/static/admin/assets/js/plugins/layer/layer.js"></script>
<script src="/public/static/admin/assets/js/plugins/toastr/toastr.min.js"></script>
<script src="/public/static/admin/assets/js/plugins/datapicker/bootstrap-datepicker.js"></script>
<script src="/install/js/ajaxForm.js"></script>
<script>
    //回车登录
    $(document).keyup(function(event){
        if(event.keyCode ==13){
            login();
        }
    });

    /*登录*/
    function login() {
        //判空
        var name=$("#name").val();
        var pwd=$("#pwd").val();
        if(name==""){
            $("#errMsg").html("用户名不能为空！");
            return;
        }

        if(pwd==""){
            $("#errMsg").html("密码不能为空！");
            return;
        }
        <?php if(cache('captcha_flag')==1): ?>
        var captcha=$("#captcha").val();
        if(captcha==""){
            $("#errMsg").html("验证码不能为空！");
            return;
        }
        <?php endif; ?>
        $.ajax({
            url: "<?php echo U('admin/index/dologin'); ?>",
            type: 'POST',
            dataType: 'json',
            data:$("#login-form").serializeJSON(),
            success: function (res) {
                if (res.rc == 0) {
                    location.replace("/admin/index/index");
                } else {
                    $("#errMsg").html(res.msg);
                    if(res.data==1){
                        refreshVerify();
                    }
                }
            }
        });
    }

    /**
     * 刷新验证码
     */
    function refreshVerify() {
        var ts = Date.parse(new Date())/1000;
        var img = document.getElementById('verify_img');
        img.src = "/captcha?id="+ts;
    }
</script>
